package com.qys.livesMall.shop.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.qys.livesMall.shop.modal.entity.ShopGoodsSku;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * sku库存 服务类
 * </p>
 *
 * @author gmx
 * @since 2023-06-07
 */
public interface ShopGoodsSkuService extends IService<ShopGoodsSku> {
    Long countSkuNum(Long shopId);
    List<ShopGoodsSku> queryByShopId(Long shopId);

    ShopGoodsSku getGoodsSku(String skuId, Long shopId);

    /**
     * 获取店铺sku消息
     * @param shopIds
     * @return
     */
    List<ShopGoodsSku> getAllSku(List<Long> shopIds);
    /**
     * 根据shopGoodsInfoId获取店铺sku消息
     * @param shopGoodsInfoIds
     * @return
     */
    List<ShopGoodsSku> getAllSkuByGoodsInfoId(List<Long> shopGoodsInfoIds, BigDecimal amount);

    List<ShopGoodsSku> getBySku(List<Long> shopSkuIds);

    BigDecimal getPostage(List<Long> skuIds);

    /**
     * 获取指定条数的随机商品
     * @param shopId
     * @param limit
     * @return
     */
    List<ShopGoodsSku> getRandSkus(Long shopId,int limit);

    /**
     * 查询商品来自哪个直播中的场次
     *
     * @param skuId
     * @param liveIds
     * @return
     */
    List<Long> getLivesSessionForSku(Long skuId, List<String> liveIds);

    List<Long> getSkuIdsByGoodsId(Long shopGoodsId);

    ShopGoodsSku getSkuByGoods( List<Long> shopGoodsIds,BigDecimal amount, Long shopId);
}
